//
//  AddViewController.m
//  babyMemoryPro
//
//  Created by student on 15-7-7.
//  Copyright (c) 2015年 niit. All rights reserved.
//

#import "AddViewController.h"
#import "HeightandWeight.h"

@interface AddViewController ()

@end

@implementation AddViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (IBAction)addPressed:(id)sender {
    HeightandWeight *model=[[HeightandWeight alloc]init];
    model.height=_heightTextfield.text;
    model.weight=_weightTextField.text;
    if (self.delegate && [self.delegate respondsToSelector:@selector(passValue:)]) {
        [self.delegate passValue:model];
    }
    [self.navigationController popViewControllerAnimated:YES];


}
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
    [self.view endEditing:YES];
}
@end
